From e3bd926c1ef83027c756488ba19f4353930fc6db Mon Sep 17 00:00:00 2001 From: Gabor Kelemen Date: Tue, 10 Aug 2010 00:11:40 -0400 Subject: [PATCH] Set translation domain for parameter_string in gtk_init_with_args This was requested in bug 554926. --- gtk/gtkmain.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index cf3cd53da1..ea922a8772 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -817,24 +817,24 @@ gtk_get_option_group (gboolean open_default_display) * @argc: a pointer to the number of command line arguments. * @argv: a pointer to the array of command line arguments. * @parameter_string: a string which is displayed in - * the first line of output, after + * the first line of output, after * programname [OPTION...] * @entries: a %NULL-terminated array of #GOptionEntrys * describing the options of your program * @translation_domain: a translation domain to use for translating * the output for the options in @entries - * with gettext(), or %NULL - * @error: a return location for errors + * and the @parameter_string with gettext(), or %NULL + * @error: a return location for errors * - * This function does the same work as gtk_init_check(). - * Additionally, it allows you to add your own commandline options, - * and it automatically generates nicely formatted + * This function does the same work as gtk_init_check(). + * Additionally, it allows you to add your own commandline options, + * and it automatically generates nicely formatted * output. Note that your program will * be terminated after writing out the help output. * - * Returns: %TRUE if the GUI has been successfully initialized, + * Returns: %TRUE if the GUI has been successfully initialized, * %FALSE otherwise. - * + * * Since: 2.6 */ gboolean @@ -858,14 +858,15 @@ gtk_init_with_args (gint *argc, return FALSE; gtk_group = gtk_get_option_group (TRUE); - + context = g_option_context_new (parameter_string); g_option_context_add_group (context, gtk_group); - + g_option_context_set_translation_domain (context, translation_domain); + if (entries) g_option_context_add_main_entries (context, entries, translation_domain); retval = g_option_context_parse (context, argc, argv, error); - + g_option_context_free (context); return retval; -- 2.30.2